package xyz.jangle.base;
/**
 * Example13_8 树集
 * @author Administrator
 *
 */
public class Student2 implements Comparable<Student2> {
	
	private String name;
	
	private int english;
	
	public Student2(String name, int english) {
		super();
		this.name = name;
		this.english = english;
	}

	@Override
	public int compareTo(Student2 o) {
		//如果不判断值相等的情况，后元素无法被添加(丢失)
		if(this.english - o.english ==0)
			return 1;
		else
			return this.english - o.english;
	}

	public String getName() {
		return name;
	}

	public int getEnglish() {
		return english;
	}
}
